﻿
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    height: 100vh;
    margin: 0;
}

.app-container {
    display: flex;
    height: 100vh;
}

.chat-container {
    display: flex;
    height: 100%;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    background-color: white;
}

.user-profile {
    width: 280px;
    background-color: #2c3e50;
    color: white;
    padding: 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #34495e;
}

.profile-header {
    text-align: center;
    margin-bottom: 20px;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    color: white;
    background-color: #3498db;
}

.user-name {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.user-email {
    color: #bdc3c7;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.user-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px;
    border-radius: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.status-indicator.online {
    background-color: #2ecc71;
    box-shadow: 0 0 8px #2ecc71;
}

.status-indicator.offline {
    background-color: #95a5a6;
}

.profile-details {
    margin-top: 20px;
}

.detail-item {
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-label {
    font-size: 0.8rem;
    color: #bdc3c7;
    margin-bottom: 4px;
}

.detail-value {
    font-size: 0.95rem;
}

.logout-btn {
    margin-top: auto;
    background-color: #e74c3c;
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-weight: bold;
}

.logout-btn:hover {
    background-color: #c0392b;
}

.user-list {
    width: 250px;
    border-right: 1px solid #e0e0e0;
    background-color: #f8f9fa;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.user-list-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #ecf0f1;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-count {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.user-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-item:hover {
    background-color: #e9ecef;
}

.user-item.active {
    background-color: #e3f2fd;
    font-weight: bold;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.user-item-name {
    flex: 1;
}

.unread-count {
    background-color: #3498db;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 0.7rem;
}

.no-users {
    padding: 20px;
    text-align: center;
    color: #7f8c8d;
}

.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f5f5f5;
}

.chat-header {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
    background-color: white;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-title {
    font-size: 1.1rem;
}

.chat-actions {
    display: flex;
    gap: 10px;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #f5f5f5;
}

.message {
    margin-bottom: 15px;
    max-width: 70%;
    position: relative;
}

.message.sent {
    margin-left: auto;
}

.message.received {
    margin-right: auto;
}

.message-bubble {
    padding: 12px 15px;
    border-radius: 18px;
    position: relative;
    word-break: break-word;
}

.message.sent .message-bubble {
    background-color: #3498db;
    color: white;
    border-bottom-right-radius: 0;
}

.message.received .message-bubble {
    background-color: white;
    border-bottom-left-radius: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.message-header {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.message.sent .message-header {
    color: rgba(255, 255, 255, 0.8);
}

.message.received .message-header {
    color: #3498db;
}

.message-time {
    font-size: 0.7em;
    color: #7f8c8d;
    margin-top: 5px;
    text-align: right;
}

.message-input {
    padding: 15px;
    background-color: white;
    border-top: 1px solid #e0e0e0;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 20px;
    outline: none;
}

.input-group input:focus {
    border-color: #3498db;
}

.input-group button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background-color: #3498db;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

.input-group button:hover {
    background-color: #2980b9;
}

.input-group button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

.input-hint {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 5px;
    padding-left: 10px;
}

.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-form {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.login-title {
    text-align: center;
    margin-bottom: 25px;
    color: #2c3e50;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.alert {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 4px;
    color: white;
    z-index: 1000;
    animation: slideIn 0.3s, fadeOut 0.5s 2.5s forwards;
}

.toast-info {
    background-color: #17a2b8;
}

.toast-success {
    background-color: #28a745;
}

.toast-warning {
    background-color: #ffc107;
    color: #212529;
}

.toast-error {
    background-color: #dc3545;
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}
    